package com.smq.chatserver.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.smq.chatserver.bean.message.Message;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface MessageMapper extends BaseMapper<Message> {
    @Select("SELECT * FROM message WHERE (`from` = #{userId} OR `to` = #{userId}) AND `time` > #{time};")
    List<Message> query(String userId, Long time);

}